package com.ssy.lingxi.order.model.dto;

import org.springframework.util.StringUtils;

import java.io.Serializable;
import java.util.Objects;

/**
 * 店铺、商城Logo查询
 * @author 万宁
 * @version 2.0.0
 * @date 2021-10-29
 */
public class VendorLogoDTO implements Serializable {
    private static final long serialVersionUID = -1627734862726143894L;

    public VendorLogoDTO(Long shopId, Long vendorMemberId, Long vendorRoleId) {
        this.shopId = shopId;
        this.vendorMemberId = vendorMemberId;
        this.vendorRoleId = vendorRoleId;
        this.name = "";
        this.logo = "";
    }

    public VendorLogoDTO(Long shopId, Long vendorMemberId, Long vendorRoleId, String name, String logo) {
        this.shopId = shopId;
        this.vendorMemberId = vendorMemberId;
        this.vendorRoleId = vendorRoleId;
        this.name = StringUtils.hasLength(name) ? name : "";
        this.logo = StringUtils.hasLength(logo) ? logo : "";
    }

    /**
     * 商城Id
     */
    private Long shopId;

    /**
     * 供应会员Id
     */
    private Long vendorMemberId;

    /**
     * 供应会员角色Id
     */
    private Long vendorRoleId;

    /**
     * 会员名称、或店铺名称、或商城名称
     */
    private String name;

    /**
     * 店铺Logo，或商城Logo
     */
    private String logo;

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Long getVendorMemberId() {
        return vendorMemberId;
    }

    public void setVendorMemberId(Long vendorMemberId) {
        this.vendorMemberId = vendorMemberId;
    }

    public Long getVendorRoleId() {
        return vendorRoleId;
    }

    public void setVendorRoleId(Long vendorRoleId) {
        this.vendorRoleId = vendorRoleId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        VendorLogoDTO that = (VendorLogoDTO) o;
        return Objects.equals(shopId, that.shopId) &&
                Objects.equals(vendorMemberId, that.vendorMemberId) &&
                Objects.equals(vendorRoleId, that.vendorRoleId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(shopId, vendorMemberId, vendorRoleId);
    }
}
